exports.install = function (Vue, options) {
	
	//定义全局的方法,使用方法  this.changeData()
    Vue.prototype.changeData = function (){
        
    };

    Vue.prototype.wodetian = function (){
        return "123123";
    };


    Vue.prototype.$config = function (key){
        var arr={
            'url':"http://baidu.com",
            'name':'123123',
            'adminEmail':"php@123.com",

        };
        if(arr[key]==null){
            //则包含该元素
            return null;
        }
        var value=arr[key];
        return value;
    };


    Vue.prototype.$host = function (){
        var host="";
        var debug=this.$C('debug');
        if(debug==true){
        host=this.$C('develop_host');
        }else{
        host=this.$C('formal_host');
        }
        return host;
    };

    Vue.prototype.$C = function (key){
        
        var arr={
            'debug':true,
            'develop_host':"http://192.168.0.9:9090/",
            'formal_host':"http://cloud.wlphp.cn:8080/",
            'console':true,
            // 'host':"cloud.wlphp.cn:8080"
        }

        //全局的console.log 禁止输出
        if(arr.console==false){
            console.log=function(){};
        }
        

        if(arr[key]==null){
            return null;
        }else{
            return arr[key];
        }
    };




    Vue.prototype.GetCookie = function (cookieName){
       var name = cookieName + "=";
         var ca = document.cookie.split(';');
                for (var i = 0; i < ca.length; i++) {
                    var c = ca[i];
                    while (c.charAt(0) == ' ') c = c.substring(1);
                    if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
                }
                return "";
    };



    Vue.prototype.SetCookie = function (cname, cvalue, exdays){

            var d = new Date();
            d.setTime(d.getTime() + (exdays * 10 * 60 * 60 * 1000));
            var expires = "expires=" + d.toUTCString();
            // console.info(cname + "=" + cvalue + "; " + expires);
            document.cookie = cname + "=" + cvalue + "; " + expires;
            // console.info(document.cookie);

    };

    Vue.prototype.$empty = function (val){

        var type=val.constructor;

        var isok=false;
        if (type===String) {
                if(val.length<1 || val=="" || val==null ){
                        isok=true
                }
        }else if(type===Array){
                if(val.length<1 || val=="" || val==null ){
                        isok=true
                }
        }
        return isok
       
};


Vue.prototype.$date=function (val) {

        var date=new Date(val);
        var year=date.getFullYear();
        /* 在日期格式中，月份是从0开始的，因此要加0
         * 使用三元表达式在小于10的前面加0，以达到格式统一  如 09:11:05
         * */
        var month= date.getMonth()+1<10 ? "0"+(date.getMonth()+1) : date.getMonth()+1;
        var day=date.getDate()<10 ? "0"+date.getDate() : date.getDate();
        var hours=date.getHours()<10 ? "0"+date.getHours() : date.getHours();
        var minutes=date.getMinutes()<10 ? "0"+date.getMinutes() : date.getMinutes();
        var seconds=date.getSeconds()<10 ? "0"+date.getSeconds() : date.getSeconds();
        // 拼接
        // return year+"-"+month+"-"+day+" "+hours+":"+minutes+":"+seconds;
        return year+"-"+month+"-"+day;

}



   Vue.prototype.message = function (type,data){
       if(type=="ok"){
            $("#ok").html(data);
            $("#ok").fadeIn();
            setTimeout(function () {
                $("#ok").fadeOut();
            },1000)
        }else{
            $("#no").html(data);
            $("#no").fadeIn();
            setTimeout(function () {
                $("#no").fadeOut();
            },1000)
        }
    };

    Vue.prototype.ymh = function (val){

        
    };



    

};